package cn.lyn4ever.goods.web.service.impl;

import cn.lyn4ever.entity.GoodsSpu;
import cn.lyn4ever.goods.web.mapper.GoodsSpuDao;
import cn.lyn4ever.goods.web.service.GoodsSpuService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 商品的spu表，一个商品对应一行记录(GoodsSpu)表服务实现类
 *
 * @author makejava
 * @since 2020-03-26 22:55:31
 */
@Service("goodsSpuService")
public class GoodsSpuServiceImpl implements GoodsSpuService {
    @Resource
    private GoodsSpuDao goodsSpuDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public GoodsSpu queryById(Integer id) {

        return this.goodsSpuDao.queryById(id);
    }

    @Override
    public List<GoodsSpu> getAllGoodsSpu() {
        List<GoodsSpu> list =  goodsSpuDao.getAllGoods();

        return list;
    }

    @Override
    public int getGoodsCount() {
        return goodsSpuDao.getGoodsCount();
    }


}